package com.firmboy.jdbc.xa;

import com.mysql.jdbc.jdbc2.optional.MysqlXADataSource;
import org.junit.jupiter.api.Test;

import javax.sql.XAConnection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author firmboy
 * @create 2018-05-28 下午1:16
 **/
public class XATest {


    @Test
    public void test() throws SQLException {

        String classes = "com.mysql.jdbc.Driver";
        String url = "jdbc:mysql://47.95.11.244:3306/yangjian";
        String username = "root";
        String passwd = "root";

        MysqlXADataSource dataSource = new MysqlXADataSource();
        dataSource.setUrl(url);
        dataSource.setUser(username);
        dataSource.setPassword(passwd);

        XAConnection xaConnection = dataSource.getXAConnection();

    }

}
